
set mem 400000

set matsize 200
sort nid3 congress


**************Table 1 Column 1******************************
**All CD's, including trend interacted with region variables**
xi: newey congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 trend easttrend midwesttrend westtrend i.state, lag(4) force

predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare


***Supplemental Information, Table A.1*************************

**Column 1**
logit ab lagturndist pelec lagmargin if newyear>=1886 & lagab==0 & newyear<=1940, robust cluster(state)

**Column 2**
logit pc lagturndist pelec lagmargin if year>=888 & lagab==0 & ab==1 & year<=940, robust cluster(state)



************Robustness checks: Supplemental Information, Table A.2. *********************
**District-level fixed effects, Column 1**
xi: xtreg congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 trend easttrend midwesttrend westtrend i.state, fe

**Dropping redistricting years, Column 2**
xi: newey congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 trend easttrend midwesttrend westtrend i.state if redistr==0, lag(4) force

predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare


**Adding the presence of Governor and/or Senate elections, Column 3**
xi: newey congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 govelec senelec trend easttrend midwesttrend westtrend i.state, lag(4) force

predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare


**Clustering by year, Column 4**
xi: reg congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 trend easttrend midwesttrend westtrend i.state, cluster(newyear)



**Driscoll-Kraay Standard Errors, Column 5 -- NOTE: You need to first download the xtscc routine if not already installed in Stata***

*** net install xtscc***

xi: xtscc congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 trend easttrend midwesttrend westtrend i.state, lag(4) 


**Using a two-election average of presidential competition, Column 6**
xi: newey congturndist ob pc pelec offpelec offnovember margin twoperiodcomp twoperiodcompint laghousecomp regist fsuffrage fsuffrageint elg1000 trend easttrend midwesttrend westtrend i.state, lag(4) force


predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare

**Using a three-election average of presidential competition, Column 7**
xi: newey congturndist ob pc pelec offpelec offnovember margin threeperiodcomp threeperiodcompint laghousecomp regist fsuffrage fsuffrageint elg1000 trend easttrend midwesttrend westtrend i.state, lag(4) force


predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare


**************************************************************************************

******Cross Validation, Supplmental Information, Table A.3*****


**Taking out the South**
xi: newey congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 i.midwest|trend i.west|trend i.state if south==0, lag(4) force


predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare

**Taking out the Midwest**
xi: newey congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 i.east|trend i.west|trend i.state if midwest==0, lag(4) force


predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare

**Taking out the East**
xi: newey congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 i.midwest|trend i.west|trend i.state if east==0, lag(4) force


predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare

**Taking out the West
xi: newey congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 i.midwest|trend i.east|trend i.state if west==0, lag(4) force


predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare


**********************************************************************************************************


**Estimating with a simple trend**
xi: newey congturndist trend, lag(4) force

predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare

**Estimating with trend and state effects**

xi: newey congturndist trend i.state, lag(4) force

predict rsquare if e(sample)
corr congturndist rsquare if e(sample)
di r(rho)^2

drop rsquare

**
xi: newey congturndist ob pc pelec offpelec offnovember margin prescomp midcompint laghousecomp regist fsuffrage fsuffrageint elg1000 trend i.state, lag(4) force


